package com.taotao.manager.feign;


import com.github.pagehelper.PageInfo;
import com.taotao.common.dto.TbItem;
import com.taotao.common.pojo.EasyUITreeNode;
import com.taotao.common.pojo.TaotaoResult;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by zhang_xming on 2017/2/13.
 */
@FeignClient(name = "taotao-item")
public interface ItemFeignClient {
    /**
     * 通过Id查找实体
     * @param itemId
     * * @return
     */
    @RequestMapping(value = "/item/{itemId}", method = RequestMethod.GET)
    public TbItem getItemById(@PathVariable("itemId") Long itemId);

    @RequestMapping(value = "/item/list", method = RequestMethod.POST)
    public PageInfo<TbItem> getItemList(@RequestParam("page") Integer page,
                                        @RequestParam("rows") Integer rows);

    @RequestMapping(value = "/item/save", method = RequestMethod.POST)
    public TaotaoResult addItem(@RequestBody TbItem item, @RequestParam("desc") String desc);

    @RequestMapping(value = "/item/cat/list", method = RequestMethod.GET)
    public List<EasyUITreeNode> getItemCatList(@RequestParam("parentId") Long parentId);
}
